$(document).ready( function () {
    $("#code_submit").click( function() {

	code = $("textarea[name=code]").val();
	language = $("select[name=language]").val();
	pid = $("#pid").text();
	if(code == "" ) {
	    alert("No data input");
	} else {
	    $.post(
		"\questions", 
		{
		    pid : pid,
		    code : code,
		    language : language
		},
		function(data,status) {
		    if (status == '405')
		       	alert("Server Error 405")
		    else
			alert("submit success!");
		});
	    $('#myModal').modal('hide');
	}
    });
});